<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>44-异常处理-throw抛出异常</title>
</head>
<body>
    <script>
        // 异常处理 - throw抛出异常
        function count(x, y) {
            if(!x || !y) {
                // throw '请输入参数'
                throw new Error('函数的参数不能为空')
                // console.log(111)
            }
            return x + y
        }
        count()
    </script>
</body>
</html>